attribute vec4 vPosition;
attribute vec3 vNormal;

// output values will be interpreted per-fragment
varying vec3 fN;
varying vec3 fE;
varying vec3 fL;

uniform mat4 OriginTranslation;
uniform mat4 ModelView;
uniform mat4 ModelTranslation;
uniform mat4 ModelRotation;
uniform vec4 LightPosition;
uniform mat4 Projection;
uniform int ShadingType;

mat4 ObjectTransform = ModelTranslation;

void main( void )
{
	fN = vec3(ObjectTransform * vec4(vNormal,0.0));
	fE = vec3(ObjectTransform * vPosition);
	fL = vec3(LightPosition);
	
	if ( LightPosition.w != 0.0 )
	{
		fL = vec3(LightPosition - vPosition);
	}

	gl_Position = Projection * ModelView * ObjectTransform * vPosition;
}